VERSION 01
Our first attempt at the map demonstrates how important formatting maps can be in communicating information effectively. In this example, the basemap distracts from the other layers and it is hard to distinguish what the map's features represent. The open space polygons are colored blue, which might be confused with water. The commercial parking points are too large and the star shape adds visual complexity, which . The metered parking polygons are almost invisible.
ggplot() +
#TITLE
ggtitle("CAMBRIDGE PARK [ ING ]") +
theme(
plot.title = element_text(
color="black",
size=10,
face="bold", #FONT FACE OPTIONS = PLAIN, BOLD, BOLD.ITALIC, ITALIC
vjust = 5,
hjust = .5))+
#BASE MAP
annotation_map_tile(
zoomin = 0,
progress = "none",
type = "stamenwatercolor",
alpha = .5) +
geom_sf() +
labs(caption = "Map tiles by Stamen Design. Data by OpenStreetMap") +
#DATA
geom_sf(
data = openspace,
color = NA,
alpha = 0.5,
aes(fill = "Open Space")
) +
geom_sf(
data = meters,
color = NA,
shape = NA,
aes(fill = "Metered Parking")
) +
geom_sf(
data = commercialparking,
shape = 11,
size = 5,
fill = NA,
aes(color = "Commercial Parking")
) +
scale_fill_manual(values = c("brown1", "blue"), name = "") +
scale_color_manual(values = "brown1", name = "") +
theme_void()
VERSION 02
This first map uses a high contrast dark theme. Open space polygons and commercial parking points pop from the page, while the metered parking more subtly suggests denser corridors, where people will pay to park on the street.
ggplot() +
ggtitle("Cambridge Park(ing)") +
#BASE MAP
annotation_map_tile(
zoomin = 0,
progress = "none",
type = "cartodark") +
geom_sf() +
labs(caption = "Map tiles and data by OpenStreetMap") +
#DATA
geom_sf(
data = openspace,
color = NA,
alpha = 0.6,
aes(fill = "Open Space")
) +
geom_sf(
data = meters,
fill = "white",
aes(color = "Parking Meters")
) +
geom_sf(
data = commercialparking,
shape = 20,
size = 3,
aes(color = "Commercial Parking")
) +
scale_color_manual(values = c("deeppink", "darkviolet"), name = "") +
scale_fill_manual(values = "chartreuse", name = "") +
theme_void()
VERSION 03
This next map uses a toned-down palette. The simple basemap allows the viewer to focus on the point and polygon layers atop it. Changing the symbology of the metered parking polygons to have just a fill with no outline shows the true size of the parking spaces, but makes them a bit hard to find.
ggplot() +
ggtitle("Cambridge Park(ing)") +
#BASE MAP
annotation_map_tile(
zoomin = 0,
progress = "none",
type = "cartolight") +
geom_sf() +
labs(caption = "Map tiles by OpenStreetMap; data from City of Cambridge") +
#DATA
geom_sf(
data = openspace,
color = NA,
alpha = 0.5,
aes(fill = "Open Space")
) +
geom_sf(
data = meters,
color = NA,
shape = NA,
aes(fill = "Metered Parking")
) +
geom_sf(
data = commercialparking,
shape = 3,
size = 2,
fill = NA,
aes(color = "Commercial Parking")
) +
scale_fill_manual(values = c("brown3", "forestgreen"), name = "") +
scale_color_manual(values = "brown1", name = "") +
theme_void()
VERSION 04
To test a new representation of the metered parking spaces, we derived the centroids of each metered parking polygon. This means that metered parking now appears as points, like the commercial parking layer. The orange color distinguishes metered parking from commercial parking, while keeping them in the same visual category (i.e. warm color = parking). For an unknown reason, the centroid points become black and deformed when a basemap was added, so I removed the basemap and reinserted coordinate marks for context.
#finding centroids of metered parking polygons
ggplot(st_centroid(meters)) +
geom_sf(
size = 0.1,
shape = 20,
aes(color = "Metered Parking"),
alpha = .5
) +
#TITLE
ggtitle("CAMBRIDGE PARK [ ING ]") +
theme(
plot.title = element_text(
color="black",
size=11,
face="bold", #FONT FACE OPTIONS = PLAIN, BOLD, BOLD.ITALIC, ITALIC
))+
#FORMAT TEXT + LABELS
easy_center_title()+
easy_move_legend("right")+
easy_x_axis_labels_size(8)+
easy_y_axis_labels_size(8)+
#open space and commercial parking
geom_sf(
data = openspace,
color = NA,
aes(fill = "Open Space"),
alpha =.3,
) +
geom_sf(
data = commercialparking,
shape = 20,
size = 3,
aes(color = "Commercial Parking"),
) +
#LEGEND
scale_color_manual(values = c("cyan4", "mediumturquoise"), name = "") +
scale_fill_manual(values = "forestgreen", name = "") +
theme(panel.background = element_rect(fill = "white"),
legend.key = element_rect(fill = "white"))
VERSION 05
insert text here
ggplot()+
#TITLE + AXIS LABELS
#TITLE
ggtitle("CAMBRIDGE PARKING IN RELATION TO OPEN SPACE") +
theme(
#ADJUST TITLE
plot.title = element_text(
color="black",
size=10,
face="bold", #FONT FACE OPTIONS = PLAIN, BOLD, BOLD.ITALIC, ITALIC
vjust = 5,
hjust = .5))+
theme(plot.margin = unit(c(1,1,1,1), "cm"),
#CREATE BACKGROUND
plot.background = element_rect(
fill = "gray95",
colour = "black",
size = 1
),
panel.background = element_rect(fill = "grey92", colour = NA))+
#X AXIS
# xlab("LONGITUDE") +
# theme(
# axis.title.x = element_text(
# size=7,
# vjust = -2.5)) +
#Y AXIS
# ylab("LATITUDE")+
# theme(
# axis.title.y = element_text(
# size=7,
# vjust = 5)) +
#FORMAT TEXT + LABELS
easy_center_title()+
easy_move_legend("right")+
easy_x_axis_labels_size(7)+
easy_y_axis_labels_size(7)+
#BASE MAP
annotation_map_tile(
zoomin = 0,
progress = "none",
type = "cartolight",
alpha = .5)+
#CAPTION
labs(
caption = "Map tiles and data by OpenStreetMap",
size = .125)+
theme(plot.caption = element_text(
color = "grey50",
face = "italic",
size = 7))+
#DATA
#commercial parking
geom_sf(data = commercialparking,
aes(color="Commercial Parking Lots"),
alpha = .5,
size = 2,
fill = NA,
) +
#metered parking
geom_sf(
data = meters,
alpha = 1,
fill = NA,
aes(color="Metered Parking")
) +
#open space
geom_sf(
data = openspace,
aes(fill="Parks"),
alpha = 0.25,
color = "cadetblue4"
) +
#APPEARANCE
#themes
scale_fill_manual(values = "cadetblue4", name = "") +
scale_color_manual(values = c("coral2", "coral4"), name = "") +
#add a scale
annotation_scale(location = "bl",
width_hint = 0.5,
height = unit(0.125,"cm"),
line_width = .125)+
#add an arrow
annotation_north_arrow(
pad_x = unit(7, "cm"),
pad_y = unit(.25, "cm"),
height = unit(0.5, "cm"),
width = unit(0.5, "cm"),
#north arrow style
style = north_arrow_orienteering(
text_size = 1))+
theme(panel.background = element_rect(fill = "white", color = "black"),
legend.background = element_rect(fill = "grey95", color = NULL))